#pragma once
#include "d3dUtil.h"

class Ball
{
	private:
		//param: ID3DXMesh ballMesh is the variable that represents the mesh of the ball
		ID3DXMesh* ballMesh;
		
		//param: float radius, uint slices, uint stacks, variables used to create the sphere
		float radius;
		unsigned int slices;
		unsigned int stack;

		//param: float posX, posY, posZ, represent the position of the ball
		float posX;
		float posY;
		float posZ;

		float velX;
		float velY;
		float velZ;

		int mass;

	public:
		Ball();
		Ball(float, unsigned int, unsigned int, float, float, float, int);
		~Ball();

		void createBall(float, unsigned int, unsigned int);

		void draw();

		void updatePosX(float dx) { posX += dx; }
		void updatePosY(float dy) { posY += dy; }
		void updatePosZ(float dz) { posZ += dz; }

		float getPosX() {return posX;}
		float getPosY() {return posY;}
		float getPosZ() {return posZ;}

		float getVelX() {return velX;}
		float getVelY() {return velY;}
		float getVelZ() {return velZ;}

		void updateVelX(float dx) {velX += dx; if(velZ > MAXVELOCITY) velX = MAXVELOCITY; else if(velX < -MAXVELOCITY) velX = -MAXVELOCITY;}
		void updateVelY(float dy) {velY += dy;}
		void updateVelZ(float dz) {velZ += dz; if(velZ > MAXVELOCITY) velZ = MAXVELOCITY; else if(velZ < -MAXVELOCITY) velZ = -MAXVELOCITY;}

		void setVelX(float dx) {velX = dx;}
		void setVelY(float dy) {velY = dy;}
		void setVelZ(float dz) {velZ = dz;}

		float getRadius() {return radius;}
		float getMass() {return mass;}

};